package MemberService

import (
	"context"
	"gdshop-back-end-go/client-api/app/request/MemberReq"
	toolsDb "gdshop-back-end-go/common/db"
	"gdshop-back-end-go/common/response"
)

func DelFavorite(ctx context.Context, parames *MemberReq.DelFavorite) *response.JsonResponse {
	_, err := toolsDb.GetUnSafaTableAddDeleteWhere(ctx, "member_collection").Where(
		"member_id = ? AND goods_id IN (?)", parames.MemberId, parames.Ids).Delete()
	if err != nil {
		return response.FailByRequestMessage(nil, err.Error())
	}

	return response.SuccessByRequestMessage(nil, "成功")
}
